package com.powervision.mvvmdemo.ui.viewmodel

import com.powervision.base.base.BaseViewModel
import com.powervision.base.util.LogUtils
import com.powervision.http.observer.StateLiveData
import com.powervision.mvvmdemo.ui.model.NaviModel
import com.powervision.mvvmdemo.ui.repository.NaviRepository

/**
 * @auth: njb
 * @date: 2021/12/20 11:58
 * @desc: 描述
 */
class NaviViewModel :BaseViewModel(){
    private val mNaviRepository by lazy { NaviRepository() }
    val mNavListData = StateLiveData<List<NaviModel>>()

    fun navi(){
        launchWithLoading(requestBlock = {
            mNaviRepository.navi()
        }, resultCallback = {
            mNavListData.value = it
            LogUtils.d("--NaviInfo--", it.data.toString())
        })
    }
}